package pl.elka.simulator.core.mobilityManager;

import java.util.HashMap;
import java.util.Map;

public class MobilityManagerFactory {
	private Map<MobilityManagerType, IMobilityManager> patterns = new HashMap<MobilityManagerType, IMobilityManager>();
	
	private static MobilityManagerFactory instance = new MobilityManagerFactory();
	
	public IMobilityManager getMobilityManagerByType(MobilityManagerType type){
		return patterns.get(type).newInstance();
	}
	public void registerPattern(IMobilityManager manager){
		patterns.put(manager.getType(), manager);
	}
	private MobilityManagerFactory(){}
	public static MobilityManagerFactory getInstance(){
		return instance;
	}
	
}
